$OpenBSD: patch-gcc_ada_gcc-interface_Makefile_in,v 1.5 2015/02/15 11:18:14 tobiasu Exp $
--- gcc/ada/gcc-interface/Makefile.in.orig	Thu Dec 12 23:53:43 2013
+++ gcc/ada/gcc-interface/Makefile.in	Fri Feb  6 02:41:39 2015
@@ -432,6 +432,10 @@ ATOMICS_TARGET_PAIRS = \
   a-szunau.adb<a-szunau-shared.adb \
   a-szuzti.adb<a-szuzti-shared.adb
 
+# Disable shared strings because of overlapping memcpy issue
+# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64057
+ATOMICS_TARGET_PAIRS =
+
 ATOMICS_BUILTINS_TARGET_PAIRS = \
   s-atocou.adb<s-atocou-builtin.adb
 
@@ -1327,6 +1331,114 @@ ifeq ($(strip $(filter-out %86_64 freebsd%,$(arch) $(o
   EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
 
   EH_MECHANISM=-gcc
+  THREADSLIB= -lpthread
+  GMEM_LIB = gmemlib
+  LIBRARY_VERSION := $(LIB_VERSION)
+  MISCLIB = -lutil
+endif
+
+ifeq ($(strip $(filter-out %86 openbsd%,$(arch) $(osys))),)
+  LIBGNAT_TARGET_PAIRS = \
+  a-intnam.ads<a-intnam-freebsd.ads \
+  s-inmaop.adb<s-inmaop-posix.adb \
+  s-intman.adb<s-intman-posix.adb \
+  s-osinte.ads<s-osinte-openbsd.ads \
+  s-osinte.adb<s-osinte-openbsd.adb \
+  s-osprim.adb<s-osprim-posix.adb \
+  s-taprop.adb<s-taprop-posix.adb \
+  s-taspri.ads<s-taspri-posix.ads \
+  s-tpopsp.adb<s-tpopsp-posix.adb \
+  $(ATOMICS_TARGET_PAIRS) \
+  $(X86_TARGET_PAIRS) \
+  system.ads<system-openbsd-x86.ads
+
+  TOOLS_TARGET_PAIRS = \
+  mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
+  GNATLIB_SHARED = gnatlib-shared-dual
+
+  # Empty when not using ZCX
+  EH_MECHANISM=
+  THREADSLIB= -lpthread
+  GMEM_LIB = gmemlib
+  LIBRARY_VERSION := $(LIB_VERSION)
+  MISCLIB = -lutil
+endif
+
+ifeq ($(strip $(filter-out %86_64 openbsd%,$(arch) $(osys))),)
+  LIBGNAT_TARGET_PAIRS = \
+  a-intnam.ads<a-intnam-freebsd.ads \
+  s-inmaop.adb<s-inmaop-posix.adb \
+  s-intman.adb<s-intman-posix.adb \
+  s-osinte.ads<s-osinte-openbsd.ads \
+  s-osinte.adb<s-osinte-openbsd.adb \
+  s-osprim.adb<s-osprim-posix.adb \
+  s-taprop.adb<s-taprop-posix.adb \
+  s-taspri.ads<s-taspri-posix.ads \
+  s-tpopsp.adb<s-tpopsp-posix.adb \
+  $(ATOMICS_TARGET_PAIRS) \
+  $(X86_64_TARGET_PAIRS) \
+  system.ads<system-openbsd-x86_64.ads
+
+  TOOLS_TARGET_PAIRS = \
+  mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
+  GNATLIB_SHARED = gnatlib-shared-dual
+
+  # Empty when not using ZCX
+  EH_MECHANISM=
+  THREADSLIB= -lpthread
+  GMEM_LIB = gmemlib
+  LIBRARY_VERSION := $(LIB_VERSION)
+  MISCLIB = -lutil
+endif
+
+ifeq ($(strip $(filter-out sparc64 openbsd%,$(arch) $(osys))),)
+  LIBGNAT_TARGET_PAIRS = \
+  a-intnam.ads<a-intnam-freebsd.ads \
+  s-inmaop.adb<s-inmaop-posix.adb \
+  s-intman.adb<s-intman-posix.adb \
+  s-osinte.ads<s-osinte-openbsd.ads \
+  s-osinte.adb<s-osinte-openbsd.adb \
+  s-osprim.adb<s-osprim-posix.adb \
+  s-taprop.adb<s-taprop-posix.adb \
+  s-taspri.ads<s-taspri-posix.ads \
+  s-tpopsp.adb<s-tpopsp-posix.adb \
+  $(ATOMICS_TARGET_PAIRS) \
+  $(ATOMICS_BUILTINS_TARGET_PAIRS) \
+  system.ads<system-openbsd-sparcv9.ads
+
+  TOOLS_TARGET_PAIRS = \
+  mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
+  GNATLIB_SHARED = gnatlib-shared-dual
+
+  # Empty when not using ZCX
+  EH_MECHANISM=
+  THREADSLIB= -lpthread
+  GMEM_LIB = gmemlib
+  LIBRARY_VERSION := $(LIB_VERSION)
+  MISCLIB = -lutil
+endif
+
+ifeq ($(strip $(filter-out hppa openbsd%,$(arch) $(osys))),)
+  LIBGNAT_TARGET_PAIRS = \
+  a-intnam.ads<a-intnam-freebsd.ads \
+  s-inmaop.adb<s-inmaop-posix.adb \
+  s-intman.adb<s-intman-posix.adb \
+  s-osinte.ads<s-osinte-openbsd.ads \
+  s-osinte.adb<s-osinte-openbsd.adb \
+  s-osprim.adb<s-osprim-posix.adb \
+  s-taprop.adb<s-taprop-posix.adb \
+  s-taspri.ads<s-taspri-posix.ads \
+  s-tpopsp.adb<s-tpopsp-posix.adb \
+  $(ATOMICS_TARGET_PAIRS) \
+  $(ATOMICS_BUILTINS_TARGET_PAIRS) \
+  system.ads<system-openbsd-hppa.ads
+
+  TOOLS_TARGET_PAIRS = \
+  mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
+  GNATLIB_SHARED = gnatlib-shared-dual
+
+  # Empty when not using ZCX
+  EH_MECHANISM=
   THREADSLIB= -lpthread
   GMEM_LIB = gmemlib
   LIBRARY_VERSION := $(LIB_VERSION)
